package io.ouka.jvm.hotspot.selfread.methodinvoke;

import java.util.ArrayList;
import java.util.List;

/**
 * @author ouka
 * Threads
 */
public class Threads {
    private static List<Thread> threadList;

    private static Thread currentThread;

    static {
        threadList = new ArrayList<>();
    }

    public static List<Thread> getThreadList() {
        return threadList;
    }

    public static JavaThread currentThread() {
        return (JavaThread) currentThread;
    }

    public static void setCurrentThread(Thread thread) {
        currentThread = thread;
    }

    public static void setThreadList(List<Thread> threadList) {
        Threads.threadList = threadList;
    }

    public static Thread getCurrentThread() {
        return currentThread;
    }
}
